package com.dfrobot.service;

import com.dfrobot.dao.BrandMapper;
import com.dfrobot.domain.entity.Brand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

public class HelloService {
    @Autowired
    private BrandMapper brandMapper;

    public List<Brand> getBrandList(){
        List<Brand> brandList = this.brandMapper.selectAll();
        return brandList;
    }

    public List<Brand> getBrandSelect(int id) {
        Example example = new Example(Brand.class);
        Example.Criteria criteria = example.createCriteria();
        //criteria.andLike("firstname", "%adair%");
        //criteria.andEqualTo("addressId",id);
        criteria.andLessThan("BrandID",id);
        List<Brand> brandList = this.brandMapper.selectByExample(example);
        return brandList;
    }
}
